#[cfg(feature = "chrono")]
mod localtime_chrono;
use std::time::{Duration, SystemTime};

#[cfg(feature = "chrono")]
pub use localtime_chrono::{
    LocalDate, LocalDateTime, LocalTime, datetime_format, 
    DATETIME_FORMAT, parse_datetime, TimeParseError
};

#[cfg(feature = "time")]
mod localtime_time;
#[cfg(feature = "time")]
pub use localtime_time::{LocalDateTime, DATETIME_FORMAT, TimeParseError};

/// 获取当前时间基于UNIX_EPOCH的秒数
pub fn unix_timestamp() -> u64 {
    SystemTime::now()
        .duration_since(SystemTime::UNIX_EPOCH)
        .unwrap_or(Duration::ZERO)
        .as_secs()
}
